package com.example.weatherdemotest.bean;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * 解析通过网络url获取的数据
 * "nums": 0,
 * "cityid": "101010100",
 * "city": "北京",
 * "update_time": "2023-03-20 19:55:25",
 * "data": [
 * {
 * 日期   "date": "2023-03-20",
 * 天气   "wea": "多云",
 * 天气图标 "wea_img": "yun",
 * 白天气温/最高气温    "tem_day": "16",
 * 夜间气温/最低气温    "tem_night": "7",
 * 风    "win": "西南风",
 * 风速   "win_speed": "<3级"
 * },...]
 */
public class WeatherBean {

    @SerializedName("cityid")
    private String cityId;

    @SerializedName("city")
    private String city;


    @SerializedName("update_time")
    private String updateTime;

    //data中的数据也为json对象
    //涉及知识点: json的嵌套
    @SerializedName("data")
    private List<DayWeatherBean> dayWeathers;

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public List<DayWeatherBean> getDayWeathers() {
        return dayWeathers;
    }

    public void setDayWeathers(List<DayWeatherBean> dayWeathers) {
        this.dayWeathers = dayWeathers;
    }

    @Override
    public String toString() {
        return "WeatherBean{" +
                "cityId='" + cityId + '\'' +
                ", city='" + city + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", dayWeathers=" + dayWeathers +
                '}';
    }
}
